package org.fly.jingwei.service;

import net.sf.json.JSONObject;
import org.fly.jingwei.bean.PageForBean;
import org.fly.jingwei.entity.JobEntity;
import org.fly.jingwei.entity.JobTimeSchedulerEntity;
import org.pentaho.di.core.exception.KettleException;

import javax.servlet.http.HttpServletRequest;
import java.text.ParseException;
import java.util.List;
import java.util.Map;

/**
 *
 * @author leo
 * @date 2017/2/22
 */
public interface JobService {
    JSONObject findJobs(int start, int limit, String name, String createDate, String userGroupName) throws ParseException;

    void deleteJobs(String jobPath, String flag) throws Exception;

    void executeJob(String path, Integer slaveId);

    boolean judgeJobIsAlike(JobTimeSchedulerEntity willAddJobTimer);

    void addTimeExecuteJob(String graphXml, String executionConfiguration, HttpServletRequest request) throws Exception;

    boolean beforeTimeExecuteJob(Map<String, Object> params, HttpServletRequest request);

    List<JobTimeSchedulerEntity> getAllTimerJob();

    JobEntity getJobById(Integer jobId);

    List<JobEntity> getJobPath(List<JobEntity> jobs);

    JobEntity getJobByName(String jobName);

    boolean updateJobName(String oldName, String newName);
}
